1. Technical Field
This application relates to the field of memory management, and more particularly to the field of managing dynamically allocated computer memory.
2. Description of Related Art
Host processor systems may store and retrieve data using a storage device containing a plurality of host interface units (host adapters), disk drives, and disk interface units (disk adapters). Such storage devices are provided, for example, by EMC Corporation of Hopkinton, Mass. and disclosed in U.S. Pat. No. 5,206,939 to Yanai et al., U.S. Pat. No. 5,778,394 to Galtzur et al., U.S. Pat. No. 5,845,147 to Vishlitzky et al., and U.S. Pat. No. 5,857,208 to Ofek. The host systems access the storage device through a plurality of channels provided therewith. Host systems provide data and access control information through the channels of the storage device and the storage device provides data to the host systems also through the channels. The host systems do not address the disk drives of the storage device directly, but rather, access what appears to the host systems as a plurality of logical volumes. The logical volumes may or may not correspond to the actual disk drives.
The host adapters, disk adapters, and other internal components of the storage device (such as RDF adapters, RA's) may each have their own local processor and operating system. Each request to an internal component of the storage device may be scheduled as a task that is serviced by the operating system of the internal component. In some cases, a task may temporarily need a block of memory for its processing. In those cases, it may be useful for the operating system to be able to dynamically obtain and release blocks of memory for temporary usage by the tasks. Conventionally, the available, unused, memory is maintained in a heap, and an operating system services memory requests by returning a portion of the heap memory to the requesting task. Once the requesting task has used the memory, the task calls a routine to return the memory to the heap.
In some cases, repeatedly requesting and returning memory from and to the heap results in “heap fragmentation”, where the heap memory is separated into a plurality of small portions such that it becomes difficult or impossible to service a request for a relatively large contiguous block of memory. In such cases, it may be necessary to perform a heap compaction to concatenate the plurality of small portions of memory in the heap. However, the need to perform periodic heap compactions adds overhead to the system. In addition, obtaining memory from a heap, especially a fragmented heap, adds overhead, as does the process of returning memory to the heap.
It is desirable to be able to perform dynamic memory allocation and deallocation in a way that reduces the possibility of a fragmented heap, decreases the instances of the heap becoming fragmented, and generally reduces the overhead associated with dynamically requesting and releasing blocks of memory.